Skip to main content

Class ModuleBase<T>

Provides a base class for a command module to inherit from.

Assembly: Revolt.Net.Commands.dll​
View Source​
Declaration
public abstract class ModuleBase<T> : object, IModuleBase where T : class, ICommandContext

Properties​

Context​

The underlying context of the command.

View Source​
Declaration
public T Context { get; }

Methods​

BeforeExecute(CommandInfo)​

The method to execute before executing the command.

View Source​
Declaration
protected virtual void BeforeExecute(CommandInfo command)
Parameters​
TypeNameDescription
Revolt.Commands.Info.CommandInfocommandThe Revolt.Commands.Info.CommandInfo of the command to be executed.

AfterExecute(CommandInfo)​

The method to execute after executing the command.

View Source​
Declaration
protected virtual void AfterExecute(CommandInfo command)
Parameters​
TypeNameDescription
Revolt.Commands.Info.CommandInfocommandThe Revolt.Commands.Info.CommandInfo of the command to be executed.

OnModuleBuilding(CommandService, ModuleBuilder)​

The method to execute when building the module.

View Source​
Declaration
protected virtual void OnModuleBuilding(CommandService commandService, ModuleBuilder builder)
Parameters​
TypeNameDescription
Revolt.Commands.CommandServicecommandServiceThe Revolt.Commands.CommandService used to create the module.
Revolt.Commands.Builders.ModuleBuilderbuilderThe builder used to build the module.